const path = require('path')
const paths = require('./paths')
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');

module.exports = {
  resolve: {
    modules: ['node_modules', paths.appNodeModules].concat(
      process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
    ),
    extensions: ['.web.js', '.js', '.json', '.web.jsx', '.jsx'],
    alias: {
      'react-native': 'react-native-web',
      '@': paths.appSrc
    },
    plugins: [
      new ModuleScopePlugin(paths.appSrc)
    ],
  },
  module: {
    rules: [
      {
        test: /\.(svg)$/,
        loader: 'svg-sprite',
        include: [
          require.resolve('antd-mobile').replace(/warn\.js$/, '')
        ]
      },
    ]
  }
}